#include <deque>
#include <vector>
#include "projector.h"

using namespace std;
class colorAndResponse{

public:
	colorAndResponse(){};
	~colorAndResponse(){};
	projector camera;
	void initializeGrids(int w, int h, int separation,int n_orient, int n_image);
	void computeColorResponse(float **color_a_maps,float **color_b_maps, float **color_l_maps,float *p_Mats, float *p_views, double *p_Sx, double *p_Sy, double *p_Zx, double *p_Zy, int *arg_max_map);

        void fitHistogram();	
	void fitGaussianModel(float th);
	void outputInCanonicalView(const char* path);
	void release();
	
	


private:
        int width,height;
	int n_image;
	int n_bin;
	vector<float> gridX,gridY; // in plane coordinate, vertical x, hrizontal y;
	deque< vector<float> > deformedX,deformedY;
	
	vector<bool> live_list;
	deque< vector<float> > model_param_list; // stupid but works
	deque< vector<float> > model_hist;
        vector<float> gain_list;
	float **p_a_score_map,**p_b_score_map,  **p_l_score_map;
        
};
